using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
using PowerManage.Entity.Enums;
using PowerManage.Entity.Utils;

namespace PowerManage.Entity.Dtos.Users;

/// <summary>
/// 用户创建
/// </summary>
public class UserCreateDto
{
    /// <summary>
    /// 密码
    /// </summary>
    [Required]
    [StringLength(20, MinimumLength = 6)]
    [JsonConverter(typeof(DesensitizationConverter), 2, 4)]
    public string Password { get; set; }

    /// <summary>
    /// 用户名
    /// </summary>
    [Required]
    [StringLength(20, MinimumLength = 3)] //字符串的长度在一个指定的范围内
    public string UserName { get; set; }

    /// <summary>
    /// 全名：姓名
    /// </summary>
    [MaxLength(20)]
    public string? FullName { get; set; }

    /// <summary>
    /// 状态，0：禁用，1：正常
    /// </summary>
    [Required]
    public UserStatus Status { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(500)]
    public string? Remark { get; set; }
}